package com.pj.controller;

import com.pj.common.ResultVO;
import com.pj.pojo.User;
import com.pj.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    //@RequestMapping("/add")
    //public ResultVO<String> addUser(@RequestBody @Valid User user) {
    //    //return userService.addUser(user);
    //    User user = new User();
    //}

    // localhost:8080/user/findUser
    @GetMapping("/findUser")
    public ResultVO<User> getUser() {
        User user = new User();
        user.setId(1);
        user.setAccount("z");
        user.setPassword("123456789");
        user.setEmail("28978454@qq.com");
        return new ResultVO<>(user);
    }
}
